/**
 * 基础列表
 * */

export default {
  namespaced: true,
  state: {
    // 列表页配置数据
    listData: {},
    // 列表页筛选条件组件
    formItemData: {},
    // 列表页筛选条件校验规则
    formItemDataRules: {},
    // 编辑页配置数据
    editPageData: {},
    // table 操作时对应的数据
    tableRowData: {},
    // 列表页筛选条件
    searchFormData: {},
    // 列表页筛选条件查询类型
    searchFormDataQ: {},
    // 供应商单条信息
    supplierItemData: {}
  },
  getters: {},
  mutations: {
    /**
     * @description 设置列表页整体配置数据
     * @param {Object} state vuex state
     * @param {Array} listData listData
     */
    setListData (state, listData) {
      state.listData = listData
    },
    /**
     * @description 设置列表页form 筛选数据
     * @param {Object} state vuex state
     * @param {Array} formData formData
     */
    setFormItemData (state, formItemData) {
      state.formItemData = formItemData
    },
    /**
     * @description 设置列表页form 筛选数据校验规则
     * @param {Object} state vuex state
     * @param {Array} formItemDataRules formItemDataRules
     */
    setFormItemDataRules (state, formItemDataRules) {
      state.formItemDataRules = formItemDataRules
    },
    /**
     * @description 设置编辑页form 筛选数据
     * @param {Object} state vuex state
     * @param {Array} formData formData
     */
    setEditPageData (state, formData) {
      state.editPageData = formData
    },
    /**
     * @description 操作table某行数据 如进入详情、编辑、审核等内页是用到
     * @param {Object} state vuex state
     * @param {Array} tableRowData tableRowData
     */
    setTableRowData (state, tableRowData) {
      state.tableRowData = tableRowData
    },
    /**
     * @description 设置列表页form 筛选条件
     * @param {Object} state vuex state
     * @param {Object} searchFormData searchFormData
     */
    setSearchFormData (state, searchFormData) {
      state.searchFormData = searchFormData
    },
    /**
     * @description 设置列表页form 筛选条件
     * @param {Object} state vuex state
     * @param {Object} searchFormData searchFormData
     */
    setSearchFormDataQ (state, searchFormDataQ) {
      state.searchFormDataQ = searchFormDataQ
    },
    /**
     * @description 设置列表页form 筛选条件
     * @param {Object} state vuex state
     * @param {Object} supplierItemData supplierItemData
     */
    setSupplierItemData (state, supplierItemData) {
      state.supplierItemData = supplierItemData
    },
  }
}
